/**
 * 私有代码，未经许可，不得复制、散播；
 * 否则将可能依法追究责任。
 */

package com.ebj.demo.netty.channelhandler.custom;

import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelPromise;

/**
 * 功能摘要：<p>自定义Handler--链路关闭时，释放资源</p>
 * Created by Martin on 2017/7/5.
 */
public class MyOutboundHandler extends ChannelHandlerAdapter
{
    @Override
    public void close(ChannelHandlerContext ctx, ChannelPromise promise)
            throws Exception
    {
        System.out.println("Channel is closing...");
//        Object.release();
        System.gc();
        ctx.close();
    }
}
